// https://www.luogu.com.cn/problem/P1480#submit

#include<iostream>
using namespace std;

const int N = 1e6 + 10;
int a[N], b, c[N];
int la, lc;

void div(int c[], int b, int a[])
{
	long long t = 0;
	for (int i = lc - 1;i >= 0;i--)
	{
		t = t * 10 + a[i];
		c[i] = t / b;
		t %= b;
	}

	while (lc > 1 && c[lc - 1] == 0) lc--;
}
int main()
{
	string x;
	cin >> x >> b;
	la = x.size();
	lc = la;
	for (int i = 0;i < la;i++) a[la - i - 1] = x[i] - '0';

	div(c, b, a);

	for (int i = lc - 1;i >= 0;i--)
		cout << c[i];

	return 0;
}